import request from '@/axios'
import type { CurdData } from './types'

export const getPaymentStatusApi = (params?: any) => {
  return request.get({ url: '/admin/payment/fieldEnum', params })
}
export const getListApi = (params: any) => {
  return request.get({ url: '/admin/payment', params })
}

export const delListApi = (ids: string[] | number[]): Promise<IResponse> => {
  return request.delete({ url: '/admin/payment', data: { ids } })
}

export const getInfoApi = (id: string): Promise<IResponse<CurdData>> => {
  return request.get({ url: '/admin/payment/' + id })
}

export const saveDataApi = (data: Partial<CurdData>): Promise<IResponse> => {
  if (data.id) {
    return request.put({ url: '/admin/payment', data })
  } else {
    return request.post({ url: '/admin/payment', data })
  }
}

export const getBrandListApi = (params: any) => {
  return request.get({ url: '/admin/payment/select', params })
}

export const getFieldEnumApi = (params: any) => {
  return request.get({ url: '/admin/payment/fieldEnum', params })
}

export const examineApi = (data: Partial<CurdData>): Promise<IResponse> => {
  return request.post({ url: '/admin/payment/examine', data })
}

export const proofApi = (data: Partial<CurdData>): Promise<IResponse> => {
  return request.post({ url: '/admin/payment/proof', data })
}

export const examineDataApi = (data) => {
  return request.post({ url: '/admin/payment/examine', data })
}
